from google.appengine.ext import db
from google.appengine.api import memcache
from tag import *
from user import *

class YTMessage(db.Model):
    category = db.StringProperty(multiline=False)
    ref = db.ReferenceProperty(collection_name='ytmessage_ref_set') 
    ext = db.ReferenceProperty(collection_name='ytmessage_ext_set') 

    user_from = db.ReferenceProperty(YTUser, required=True)
    user_to = db.ReferenceProperty(YTUser)
    title = db.StringProperty(multiline=False)
    content = db.TextProperty()
    link = db.LinkProperty()

    date = db.DateTimeProperty(auto_now_add=True)
    date_add = db.DateProperty(auto_now_add=True)

    type = db.IntegerProperty(default=0)
  
    tags = db.StringListProperty()
    points = db.IntegerProperty(default=0)
    hot = db.BooleanProperty(default=False)
